<?php
require_once("../cofd/common.php");
$json_j = file_get_contents("php://input");
$json_jx = json_decode($json_j, true);
$book 	= $json_jx['book'];
$fromer = $json_jx['from'];
$opinion = '《'.$book.'》'.$json_jx['talk'];
$time = date('Y-m-d H:i:s');
$sql = "INSERT INTO opinion (forer, idea,type,time) VALUES ('$fromer', '$opinion','reader','$time')";
if($conn->query($sql)){
    echo json_encode(array('code' => 200, 'msg' => '反馈成功'));
}else{
    echo json_encode(array('code' => 404, 'msg' => '反馈失败'));
}
$conn->close();